package com.project.personalfundmanager.shared.models;

import com.extjs.gxt.ui.client.data.BaseModel;
import com.project.personalfundmanager.client.common.Const;
import com.project.personalfundmanager.client.common.ModelHelper;
import com.project.personalfundmanager.client.listeners.Displayable;
import com.project.personalfundmanager.shared.DAOs.Section80CDAO;

public class Section80CModel extends BaseModel implements Displayable
{

	private static final long serialVersionUID = 4633628298895722361L;

	public Section80CModel( Section80CDAO dao )
	{
		setPF( dao.getPf() );
		setLIC( dao.getLic() );
		setPostOffice( dao.getPostOffice() );
		setNSC( dao.getNsc() );
		setNSS( dao.getNss() );
		setMutualFund( dao.getMutualFund() );
		setHouseLoan( dao.getHouseLoan() );
		setTutionFees( dao.getTutionFees() );
		setFD( dao.getFd() );
		setNHB( dao.getNhb() );
		setTotal( dao.getTotal() );
	}
	
	public static void copyToModel( Section80CModel fromModel, Section80CModel toModel )
	{
		toModel.setPF( fromModel.getPF() );
		toModel.setLIC( fromModel.getLIC() );
		toModel.setPostOffice( fromModel.getPostOffice() );
		toModel.setNSC( fromModel.getNSC());
		toModel.setNSS( fromModel.getNSS() );
		toModel.setMutualFund( fromModel.getMutualFund() );
		toModel.setHouseLoan( fromModel.getHouseLoan() );
		toModel.setTutionFees( fromModel.getTutionFees() );
		toModel.setFD( fromModel.getFD() );
		toModel.setNHB( fromModel.getNHB() );
		toModel.setTotal( fromModel.getTotal() );
	}

	public Section80CModel()
	{
		setDisplayString();
	}

	public void setDisplayString()
	{
		set( "displayString", "Sec 80C Exemption" );
	}

	public void setPF( Integer pf )
	{
		set( Const.PF, pf );
	}

	public Integer getPF()
	{
		return ModelHelper.getNullSafeInt( get( Const.PF ) );
	}

	public void setLIC( Integer lic )
	{
		set( Const.LIC, lic );
	}

	public Integer getLIC()
	{
		return ModelHelper.getNullSafeInt( get(Const.LIC ) );
	}

	public void setPostOffice( Integer postOffice )
	{
		set( Const.POST_OFFICE, postOffice );
	}

	public Integer getPostOffice()
	{
		return ModelHelper.getNullSafeInt( get( Const.POST_OFFICE ) );
	}

	public void setNSC( Integer nsc )
	{
		set( Const.NSC, nsc );
	}

	public Integer getNSC()
	{
		return ModelHelper.getNullSafeInt( get( Const.NSC ) );
	}

	public void setNSS( Integer nss )
	{
		set( Const.NSS, nss );
	}

	public Integer getNSS()
	{
		return ModelHelper.getNullSafeInt( get( Const.NSS ) );
	}

	public void setMutualFund( Integer mutualFund )
	{
		set( Const.MUTUAL_FUND, mutualFund );
	}

	public Integer getMutualFund()
	{
		return ModelHelper.getNullSafeInt( get( Const.MUTUAL_FUND ) );
	}

	public void setHouseLoan( Integer houseLoan )
	{
		set( Const.HOUSE_LOAN, houseLoan );
	}

	public Integer getHouseLoan()
	{
		return ModelHelper.getNullSafeInt( get( Const.HOUSE_LOAN) );
	}

	public void setTutionFees( Integer tutionFees )
	{
		set( Const.TUTION_FEES, tutionFees );
	}

	public Integer getTutionFees()
	{
		return ModelHelper.getNullSafeInt( get( Const.TUTION_FEES ) );
	}

	public void setFD( Integer fd )
	{
		set( Const.FD, fd );
	}

	public Integer getFD()
	{
		return ModelHelper.getNullSafeInt( get( Const.FD ) );
	}

	public void setNHB( Integer nhb )
	{
		set( Const.NHB, nhb );
	}

	public Integer getNHB()
	{
		return ModelHelper.getNullSafeInt( get( Const.NHB ) );
	}

	public void setTotal( Integer total )
	{
		set( Const.SEC80_TOTAL, total );
	}

	public Integer getTotal()
	{
		return ModelHelper.getNullSafeInt( get( Const.SEC80_TOTAL ) );
	}
}
